package com.bds.snatch.system.service;

import java.util.Date;

import javax.annotation.Resource;

import org.nutz.dao.impl.NutDao;
import org.springframework.stereotype.Component;

import com.bds.snatch.model.Message;

@Component
public class MessageService {

	@Resource
	private NutDao dao;

	public Message addMessage(Long user_id, Long biz_id, String biz_table, Long tid, String content) {
		Message message = new Message();
		message.setUser_id(user_id);
		message.setBiz_id(biz_id);
		message.setBiz_table(biz_table);
		message.setTemplate_id(tid);
		message.setContent(content);
		message.setCreate_time(new Date());
		message.setIsread(0);
		dao.insert(message);
		return message;
	}

}
